Move getting the property out of the loop, and rename the variable
authorSøren Sandmann <sandmann@redhat.com>
Tue, 16 May 2006 16:51:27 +0000 (16:51 +0000)
committerSøren Sandmann Pedersen <ssp@src.gnome.org>
Tue, 16 May 2006 16:51:27 +0000 (16:51 +0000)
Tue May 16 12:36:25 2006  Søren Sandmann  <sandmann@redhat.com>

        * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the
        property out of the loop, and rename the variable 'max_expand'.

        * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription
        for the max-child-expand property.

ChangeLog
ChangeLog.pre-2-10
gtk/gtktoolbar.c

index 4e37e15003257130a4d4b66a7fafed029000f32c..9724726fa92ff6c57321c7d5a41e378c9e0ba4bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue May 16 12:36:25 2006  Søren Sandmann  <sandmann@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the
+       property out of the loop, and rename the variable 'max_expand'.
+
+       * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription
+       for the max-child-expand property. 
+
 2006-05-16  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkprinter.c (gtk_printer_class_init): 
index 4e37e15003257130a4d4b66a7fafed029000f32c..9724726fa92ff6c57321c7d5a41e378c9e0ba4bf 100644 (file)
@@ -1,3 +1,11 @@
+Tue May 16 12:36:25 2006  Søren Sandmann  <sandmann@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the
+       property out of the loop, and rename the variable 'max_expand'.
+
+       * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription
+       for the max-child-expand property. 
+
 2006-05-16  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkprinter.c (gtk_printer_class_init): 
index 7f384d98284dc5e5c38a95dbbb8c7dc8721955bd..660661761159de93a51421ac62db224c27d733f6 100644 (file)
@@ -595,8 +595,8 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
 
   gtk_widget_class_install_style_property (widget_class,
                                            g_param_spec_int ("max-child-expand",
-                                                             P_("Maximum toolbar item spacing"),
-                                                             P_("Maximum space between the toolbar items."),
+                                                             P_("Maximum child expand"),
+                                                             P_("Maximum amount of space an expandable item will be given"),
                                                              0,
                                                              G_MAXINT,
                                                              G_MAXINT,
@@ -1591,7 +1591,9 @@ gtk_toolbar_size_allocate (GtkWidget     *widget,
    */
   if (!overflowing)
     {
+      gint max_child_expand;
       n_expand_items = 0;
+      
       for (i = 0, list = priv->content; list != NULL; list = list->next, ++i)
        {
          ToolbarContent *content = list->data;
@@ -1600,19 +1602,19 @@ gtk_toolbar_size_allocate (GtkWidget     *widget,
            n_expand_items++;
        }
       
+      max_child_expand = get_max_child_expand (toolbar);
       for (list = priv->content, i = 0; list != NULL; list = list->next, ++i)
        {
          ToolbarContent *content = list->data;
          
          if (toolbar_content_get_expand (content) && new_states[i] == NORMAL)
            {
-              gint mexpand = get_max_child_expand (toolbar);
              gint extra = size / n_expand_items;
              if (size % n_expand_items != 0)
                extra++;
 
-              if (extra > mexpand)
-                extra = mexpand;
+              if (extra > max_child_expand)
+                extra = max_child_expand;
 
              allocations[i].width += extra;
              size -= extra;